/**
 * 
 */
package com.inspectortime.domain.impl;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import com.inspectortime.domain.Employee;
import com.inspectortime.domain.InspectorCompany;
import com.inspectortime.domain.Scheduler;
import com.inspectortime.domain.type.Name;

@Entity
@Table(name = "SCHEDULER")
@PrimaryKeyJoinColumn(name="USER_ID")
public class SchedulerImpl extends UserImpl implements Scheduler {

	private InspectorCompany company;
	private String phone;
	private Employee.Status status = Employee.Status.ACTIVE;
	
	public SchedulerImpl() {}
	
	public SchedulerImpl(Name name) {
		this.setName(name);
	}
	
	@Column( length = 20 )
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column( length = 20 ) // this defaults to: @Enumerated(EnumType.ORDINAL)
	public Status getStatus() {
		return this.status;
	}

	public void setStatus(Status status) {
		this.status = status;
		
	}
	
	@ManyToOne(targetEntity = InspectorCompanyImpl.class, cascade = { CascadeType.ALL })
	public InspectorCompany getCompany() {
		return company;
	}

	public void setCompany(InspectorCompany company) {
		this.company = company;
	}
	
}
